package cn.fuxue.hrms.service.process;

import cn.fuxue.hrms.common.base.BaseEntityProcessor;
import cn.fuxue.hrms.common.entity.CvEduExp;
import cn.fuxue.hrms.common.entity.CvWorkExp;
import cn.fuxue.hrms.mapper.CvWorkExpMapper;
import cn.fuxue.hrms.service.CvWorkExpService;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Map;

@Service
public class CvWorkExpProcessor extends BaseEntityProcessor<CvWorkExp> {
    @Autowired
    private CvWorkExpMapper cvWorkExpMapper;

    private Integer cvId;

    public Integer getCvId() {
        return cvId;
    }

    public void setCvId(Integer cvId) {
        this.cvId = cvId;
    }

    @Override
    protected CvWorkExp validate(Map map) {
        CvWorkExp cvWorkExp=new CvWorkExp();
        try {
            map.put("cvId",getCvId());
            cvWorkExp.populateFromJson(map);
            return cvWorkExp;
        } catch (Exception e) {
            return cvWorkExp;
        }
    }


    @Override
    protected Integer save(CvWorkExp entity) {
        return cvWorkExpMapper.insert(entity);
    }
}
